﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using DomainDriver.DomainModeling.DataProviders;

namespace DomainDriver.DomainModeling.Configuration
{
    public class DomainDriverConfiguration : ConfigurationSection
    {
        public const string DoSubAssemblyResistration_PropertyName = "DoSubAssemblyResistration";
        public const bool DoSubAssemblyResistration_DefaultValue = false;

        [ConfigurationProperty(DoSubAssemblyResistration_PropertyName, DefaultValue = DoSubAssemblyResistration_DefaultValue, IsRequired = false)]
        public bool DoSubAssemblyResistration
        {
            get
            {
                return (bool)this[DoSubAssemblyResistration_PropertyName];
            }
            set
            {
                this[DoSubAssemblyResistration_PropertyName] = value;
            }
        }

        public const string ConnectionToUse_PropertyName = "ConnectionToUse";
        public const string ConnectionToUse_DefaultValue = "DomainDriverDatabase";

        [ConfigurationProperty(ConnectionToUse_PropertyName, DefaultValue = ConnectionToUse_DefaultValue, IsRequired = false)]
        public string ConnectionToUse
        {
            get
            {
                return (string)this[ConnectionToUse_PropertyName];
            }
            set
            {
                this[ConnectionToUse_PropertyName] = value;
            }
        }

        public const string PersistenceTypeToUse_PropertyName = "PersistenceTypeToUse";
        public const DataSourcePersistenceType PersistenceTypeToUse_DefaultValue = DataSourcePersistenceType.None;

        [ConfigurationProperty(PersistenceTypeToUse_PropertyName, DefaultValue = PersistenceTypeToUse_DefaultValue, IsRequired = false)]
        public DataSourcePersistenceType PersistenceTypeToUse
        {
            get
            {
                return (DataSourcePersistenceType)this[PersistenceTypeToUse_PropertyName];
            }
            set
            {
                this[PersistenceTypeToUse_PropertyName] = value;
            }
        }
    }
}